import request from '@/utils/request'

// 创建仓储任务
export function createTake(data) {
  return request({
    url: '/storage/take/create',
    method: 'post',
    data: data
  })
}

// 更新仓储任务
export function updateTake(data) {
  return request({
    url: '/storage/take/update',
    method: 'put',
    data: data
  })
}

// 删除仓储任务
export function deleteTake(id) {
  return request({
    url: '/storage/take/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除仓储任务 */
export function deleteTakeList(ids) {
  return request({
    url: `/storage/take/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得仓储任务
export function getTake(id) {
  return request({
    url: '/storage/take/get?id=' + id,
    method: 'get'
  })
}

// 获得仓储任务分页
export function getTakePage(params) {
  return request({
    url: '/storage/take/page',
    method: 'get',
    params
  })
}
// 导出仓储任务 Excel
export function exportTakeExcel(params) {
  return request({
    url: '/storage/take/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}